package vn.fpt.fsoft.action.user;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import vn.fpt.fsoft.bl.LogonBL;
import vn.fpt.fsoft.user.form.LogonForm;

 
public class LogonAction extends ActionSupport{
 
	public ActionForward execute(ActionMapping mapping,ActionForm form,
		HttpServletRequest request,HttpServletResponse response) 
        throws Exception {
		
			LogonBL LogonBL =
				(LogonBL) getWebApplicationContext().getBean("logonBL");
			
			LogonForm LogonForm = (LogonForm)form;
			boolean check =	LogonBL.logon(LogonForm.getUserId(), LogonForm.getPwd());
		    if (check)    
		    	return mapping.findForward("success");
		    else
		    	return mapping.findForward("false");
	  
	}
 
}